#ifndef PAYMENTWINDOW_H
#define PAYMENTWINDOW_H

#include <QMainWindow>
#include <QModelIndexList>
#include <QPushButton>
#include <QHash>
#include "model_view/credit_card/creditcardprofile.h"


namespace Ui {
class PaymentWindow;
}

class PaymentWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit PaymentWindow(QModelIndexList &index_list, QPushButton *button, QWidget *parent = 0);
    ~PaymentWindow();
    void                  closeEvent(QCloseEvent *event);
static QHash<QString, CreditCardProfile *> *ParseCards(unsigned char key[16]);

public slots:
    void                  Payment();
    void                  StartPayment(QObject *provider);
    void                  ShowError(QString *error, QObject *item);
    void                  ShowProgress(int percent);
private:
    Ui::PaymentWindow *ui;
    QPushButton *m_button;
    QHash<QString, CreditCardProfile*> cards;
    QModelIndexList *profile_index_list;
};

#endif // PAYMENTWINDOW_H
